<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    
    <script type="text/javascript" src="js/websocket.js" /> 
    
    <f:view contentType="text/html">
        <h:head>
            <f:facet name="first">
                <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
                <title>SocketTalk</title>
            </f:facet>
        </h:head>

        <h:body onload="onLoad()">
            <p:layout fullPage="true">
             
                <p:layoutUnit position="north" size="100" resizable="false" closable="true" collapsible="true">
                    <div style="float: left;">
                        <h2>SocketTalk 0.2</h2>
                    </div>

                </p:layoutUnit>
                
                <p:layoutUnit position="south" size="110" closable="true" collapsible="true">
                    <div style="float: top; width: 98%">
                        <p:inputText type="text" id="message" style="width: 100%; " autocomplete="off" 
                               onkeyup="if (event.keyCode == 13) {sendMessage(); this.value=''}" /> 
                        <div style=" float: left;"><b>Username:</b> <div style="display: inline" id="username" ></div></div>
                        <div style=" float: right;"><b>Status:</b> <div style="display: inline" id="statusLine" >Disconnected</div></div>
                    </div>
                    <br/>
                    <div style=" width: 98%">
                        <div id="settings">
                            <button id="connectBtn" value="Disconnect" onclick="connectBtn()" 
                                    class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"> Disconnect</button>
                            <button id="chgNicknameBtn" value="Nickname" onclick="changeNickname()" 
                                    class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"> Change Nickname</button>
                        </div>
                    </div>
                </p:layoutUnit>
                
                <p:layoutUnit position="east" size="20%" header="Users" collapsible="true">
                    <div id="usersList">Users not loaded.</div>
                </p:layoutUnit>
                
                <p:layoutUnit position="center">
                    <div id="contentDiv" style="float: top; height: 100%">  </div>
                </p:layoutUnit>
            </p:layout>
        </h:body>
    </f:view>
</html>